import { useMemo } from 'react';
import AllMessage from './AllMessage/AllMessage';
import UnreadMessages from './UnreadMessages/UnreadMessages';

export const useOptionsRender = (orderClass: string) => {
    // eslint-disable-next-line react-hooks/exhaustive-deps
    const CompObj = {
        AllMessage: <AllMessage></AllMessage>,
        UnreadMessages: <UnreadMessages></UnreadMessages>,
    };
    const CompOptions = useMemo(() => CompObj[orderClass], [CompObj, orderClass]);
    return CompOptions;
};